package org.ourgrid.gridMonitor;

import java.io.IOException;
import java.io.InputStream;
import java.util.TimerTask;

public class HamsterRecuperation extends TimerTask {
	Process process = null;

	public void run() {
		if (Componente.hamsterPath != null) {
			try {
				process = Runtime.getRuntime().exec(Componente.hamsterPath + "/bin/./RecuperarOpenfire");
				InputStream in = process.getInputStream();
				int c;
				String saida = "";

				while ((c = in.read()) != -1) {
					saida += ((char) c);
				}

				System.out.println(saida);

				in.close();
			} catch (IOException e) {
				e.printStackTrace();
			} catch (Exception e) {
				e.printStackTrace();
			}
		}
	}
}
